package models

import (
	"github.com/jinzhu/gorm"
	"kop/modules/pay/entity"
)

func AutoMigrate(dB *gorm.DB) {

	dB.AutoMigrate(new(entity.Order))
	dB.AutoMigrate(new(entity.Double))
}

func GetOrder(dB *gorm.DB, orderID int) (entity.Order, error) {

	var order entity.Order
	return order, dB.First(&order, orderID).Error
}
